package org.pyq.agent;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author pengYongQiang
 * @date 2021/12/21 10:21
 */
@Component
public class AccessInterceptor implements HandlerInterceptor {


    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

        return handleExternal(request,response);

    }

    private boolean handleExternal(HttpServletRequest request, HttpServletResponse response){

        request.getHeader("aaa");

        System.out.println(request.getRequestURI());
        return true;
    }
}
